/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exercises.day01.pt3;

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.Scanner;

/**
 * MyFirstJava
 *
 * @author (jaice)
 * @version 0.1 (may 28, 2012)
 * 
 * a. Create a Java application which allows a user to store the names and grades 
 * of five students.  The application then should be able to display the list of 
 * the name and the corresponding grade.
 *
 * 
 */
public class StudentNameGrade {

    public static void main(String args[]) {
        //declare variable
        String[] names = new String[5];
        double[] grades = new double[5];

        //declare scanner
        Scanner sc = new Scanner(System.in);

        for (int x = 0; x < 5; x++) {
            //get name
            System.out.println("Enter student " + (x + 1) + " name :");
            names[x] = sc.nextLine();
            //get grade
            System.out.println("Enter student " + (x + 1) + " grade :");
            grades[x] = sc.nextDouble();
            
            sc.nextLine();

        }

           for (int x = 0; x < 5; x++) {
            //get name
            System.out.println(names[x] + " has a grade of " + grades[x]);


        }    
        


    }
}
